//
//  CPYDiscoveryPageDataDetailModel.m
//  TTMusic
//
//  Created by chenpengyu on 16/4/1.
//  Copyright © 2016年 cpy. All rights reserved.
//

#import "CPYDiscoveryPageDataDetailModel.h"

@implementation CPYDiscoveryPageDataDetailModel

- (instancetype)initWithDataSource:(NSDictionary *)dataSource {
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dataSource];
        NSMutableArray *array = [NSMutableArray arrayWithCapacity:0];
        for (NSDictionary *dic in self.songs) {
            CPYDiscoveryPageSongListModel *songsModel = [[CPYDiscoveryPageSongListModel alloc] initWithDataSource:dic];
            [array addObject:songsModel];
        }
        self.songs = [NSArray arrayWithArray:array];
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"id"]) {
        _Id = value;
    }  else if ([key isEqualToString:@"albumRightKey"]) {
        _albumRightKeyModel = [[CPYDiscoveryPageAlbumRightKeyModel alloc] init];
        [_albumRightKeyModel setValuesForKeysWithDictionary:value];
    } else if ([key isEqualToString:@"action"]) {
        _actionModel = [[CPYDiscoveryPageActionModel alloc] init];
        [_actionModel setValuesForKeysWithDictionary:value];
    }
}

@end
